#ifndef _LOG_
#define _LOG_

#include "stdio.h"
#include "stdlib.h"
#include "stdarg.h"
//LOG功能开关 0则不会进行打印
#define LOG_ENABLE 1

//颜色的宏定义
#define NONE      "\e[0m"	//消除颜色
#define LOG_RED_H "\e[1;31m"	//亮红色
#define LOG_RED_L	"\e[0;31m"	//暗红色
#define LOG_GREEN_H "\e[1;32m"
#define LOG_GREEN_L	"\e[0;32m"
#define LOG_YELLOW_H "\e[1;33m"
#define LOG_YELLOW_L	"\e[0;33m"


void log(const char *color,const char *fmt,...);
#if LOG_ENABLE

/*普通打印*/
#define LOGI(fmt,agr...)	\
do	\
{	\
	log(LOG_GREEN_L,fmt,##agr);\
}while(0)

/*警告类型*/
#define LOGW(fmt,agr...)	\
do	\
{	\
	log(LOG_RED_H,fmt,##agr);\
}while(0)

/*错误类型*/
#define LOGE(fmt,agr...)	\
do	\
{	\
	log(LOG_YELLOW_L,fmt,##agr);\
}while(0)

#else	//不会打印任何东西
	
#define LOGI(fmt,agr...)
#define LOGW(fmt,agr...)
#define LOGE(fmt,agr...)

#endif

#endif



